import request from '@/utils/request';

export function getAllDormList(params) {
  return request({
    url: "/dormitory/dms-dormitory/getAllDormList",
    method: "GET",
    params
  });
}

export function importDorm(data) {
  return request({
    url: "/dormitory/dms-dormitory/importDorm",
    method: "POST",
    data
  });
}



export function countRecordConfirmStatus() {
  return request({
    url: "/dormitory/dms-dormitory/countRecordConfirmStatus",
    method: "get",
  });
}

export function countParkStuIn() {
  return request({
    url: "/dormitory/dms-dormitory/countParkStuIn",
    method: "get",
  });
}


export function manyOpen(ids) {
  return request({
    url: "/dormitory/dms-dormitory/manyOpen",
    method: "POST",
    data: ids
  });
}


export function openNotFull() {
  return request({
    url: "/dormitory/dms-dormitory/openNotFull",
    method: "POST"
  });
}

export function listDormInfo(params) {
  return request({
    url: "/dormitory/dms-dormitory/listDormInfo",
    method: "get",
    params
  });
}


export function listRoomDeptLiveByFloor(params = {}) {
  return request({
    url: "/dormitory/dms-dormitory/listRoomDeptLiveByFloor",
    method: "get",
    params
  });
}

export function countGenderBed() {
  return request({
    url: "/dormitory/dms-dormitory/countGenderBed",
    method: "get"
  });
}

export function countDeptBed() {
  return request({
    method: "get",
    url: "/dormitory/dms-dormitory/countDeptBed"
  });
}

export function countStuIn() {
  return request({
    method: "get",
    url: "/dormitory/dms-dormitory/countStuIn"
  });
}

export function cleanNotStu() {
  return request({
    method: "post",
    url: "/dormitory/dms-dormitory/cleanNotStu"
  });
}


export function countAllParkBed() {
  return request({
    url: "/dormitory/dms-dormitory/countAllParkBed",
    method: "get"
  });
}


export function signWenming(id) {
  return request({
    url: "/dormitory/dms-dormitory/signWenming/" + id,
    method: "POST"
  });
}


export function changeDormIsNew(data) {
  return request({
    url: "/dormitory/dms-dormitory/changeDormIsNew",
    method: "POST",
    data
  });
}


export function changeHead(stuNo) {
  return request({
    url: "/dormitory/dms-dormitory/changeHead/" + stuNo,
    method: "POST"
  });
}


export function listRoomStu(room) {
  return request({
    url: "/dormitory/dms-dormitory/listRoomStu/" + room,
    method: "GET"
  });
}


export function listRoomDeptLive(params) {
  return request({
    url: "/dormitory/dms-dormitory/listRoomDeptLive",
    method: "GET",
    params
  });
}





export function listAllRoomByFloor(id) {
  return request({
    url: "/dormitory/dms-dormitory/listAllRoomByFloor/" + id,
    method: "get"
  });
}

export function listRoomByFloor(id) {
  return request({
    url: "/dormitory/dms-dormitory/listRoomByFloor/" + id,
    method: "get"
  });
}


export function listFloorByBuilding(id) {
  return request({
    url: "/dormitory/dms-dormitory/listFloorByBuilding/" + id,
    method: "get"
  });
}

export function listBuildingByPark(id) {
  return request({
    url: "/dormitory/dms-dormitory/listBuildingByPark/" + id,
    method: "get"
  });
}

export function listParkByCampus(id) {
  return request({
    url: "/dormitory/dms-dormitory/listParkByCampus/" + id,
    method: "get"
  });
}

export function listAllCampus() {
  return request({
    url: "/dormitory/dms-dormitory/listAllCampus",
    method: "get"
  });
}

export function syncOccupancy() {
  return request({
    url: "/dormitory/dms-dormitory/syncOccupancy",
    method: 'post'
  });
}


export function updateDorm(data) {
  return request({
    url: "/dormitory/dms-dormitory/updateDorm",
    method: 'post',
    data
  });
}

export function getCanDormList(data) {
  return request({
    url: '/dormitory/dms-dormitory/getCanDormList?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize,
    method: 'post',
    data
  })
}

// 查询宿舍信息列表
export function listDormitory(data) {
  return request({
    url: '/dormitory/dms-dormitory/list?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize,
    method: 'post',
    data
  })
}

// 查询宿舍信息详细
export function getDormitory(id) {
  return request({
    url: `/dormitory/dms-dormitory/${id}`,
    method: 'get'
  })
}

// 新增宿舍信息
export function addDormitory(dormitoryDto) {
  return request({
    url: '/dormitory/dms-dormitory/add',
    method: 'post',
    data: dormitoryDto
  })
}

// 修改宿舍信息
export function updateDormitory(data) {
  return request({
    url: '/dormitory/dms-dormitory/update',
    method: 'post',
    data: data
  })
}

// 删除宿舍信息
export function delDormitory(ids) {
  return request({
    url: '/dormitory/dms-dormitory/delete',
    method: 'post',
    data: ids
  })
}

// 批量添加宿舍
export function addSomeDormitory(data) {
  return request({
    url: "/dormitory/dms-dormitory/batch/add",
    method: "post",
    data
  })
}

//查看学生信息
export function listStudent(id) {
  return request({
    url: '/dormitory/dms-dormitory/student/' + id,
    method: 'get'
  })
}
